@extends('_layouts.default')
@section('content')
    <!-- this page specific styles -->
    <link rel="stylesheet" href="{{ URL::asset('/') }}css/compiled/form-showcase.css" type="text/css" media="screen" />
    <script type="text/javascript" src="{{ URL::asset('/') }}ckeditor/ckeditor.js"></script>
    {{--<script src="/cdn.ckeditor.com/4.4.7/full/ckeditor.js"></script>--}}
    <style>

        .cke_focused,
        .cke_editable.cke_focused
        {
            outline: 3px dotted blue !important;
            *border: 3px dotted blue !important;	/* For IE7 */
        }

    </style>
    <div id="pad-wrapper" class="form-page">
    <div class="row-fluid form-wrapper">
    <!-- left column -->
    <div class="span11 column">
        <form method="post" action={{ URL('admin/contentSave') }} />
        <input name="_token" type="hidden" value="{{ csrf_token() }}" />
        <input name="Info[infoId]" type="hidden" value="{{$info->id}}" />
        <input name="Info[id]" type="hidden" value="{{$content->id or 0}}" />
        <input name="Info[page_no]" type="hidden" value="{{$content->page_no or 1}}" />
        <div class="field-box">
            <label>标题：</label>
            <input class="span10 inline-input" type="text" readonly="readonly" value="{{$info->title}}">
        </div>
        <div class="field-box">
            <label>内容：</label>
            <div class="wysi-column">
                <p>
                    <textarea class="ckeditor" name='Info[content]' cols="80" id="editor" rows="50">{{$content->content or ''}}</textarea>
                </p>
            </div>
        </div>
        <div class="field-box">
            <label>保存：</label>
            <input type="submit" class="btn-glow primary" value="保存" onclick="getContents();return false;">
        </div>
        </form>
    </div>
    <script>
        function getContents() {
            var editor = CKEDITOR.instances.editor;
            $("#editor").val(editor.getData());
            this.form.submit();
        }
    </script>
@endsection